class EventLogManagerController.MainFrameWindowAdapter extends WindowAdapter
WindowAdapter
for creating
a specific adapter for the main JFrame
.
It defines the behaviour of the JFrame
when it is in the process of
being closed. The window first asks if the user is sure to close the application,
then it checks if there are some unsaved JInternalFrame
frames in the
contentArea
and asks the user if he wants to save them or not before closing them. At the end of
this process the window will close itself only if all the internal frames got closed
successfully.
WindowAdapter
,
JFrame
,
JInternalFrame
Constructor and Description |
---|
MainFrameWindowAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
windowClosing(WindowEvent e)
Invoked when a window is in the process of being closed.
|
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
public void windowClosing(WindowEvent e)
The method first asks if the user is sure to close the application,
then it checks if there are some unsaved JInternalFrame
frames in the
contentArea
and asks the user if he wants to save them or not before closing them. At the end of
this process the method will set the close operation of the window as EXIT_ON_CLOSE
only if all the internal frames got closed successfully, as DO_NOTHING_ON_CLOSE
when the first error occurs otherwise, stopping the closing process of the internal frames.
windowClosing
in interface WindowListener
windowClosing
in class WindowAdapter
e
- the WindowEvent
generated by the windowWindowEvent